package database;

import worst.shopping.WorstShoppingApplication;
import android.graphics.Bitmap;

public class Product {
	private String _name;
	private Bitmap _icon;
	private String _price;
	private String _unit;
	
	public Product(String name, Bitmap icon, String price, String unit) {
		_name = name;
		_icon = icon;
		_price = price;
		_unit = unit;
	}
	
	public String getPrice() {
		return _price;
	}

	@Override
	public boolean equals(Object o) {

		Product other = (Product)o;
		
		return other._name == this._name;
	}
	
	public String getName()
	{
		return _name;
	}
	
	public String getUnit()
	{
		return _unit;
	}
	
	public Bitmap getIcon()
	{
		if(_icon == null)
		{
			return WorstShoppingApplication.DEFAULT_PRODUCT_IMAGE;
		}
		else
		{
			return _icon;
		}
	}
	
	public void setIcon(Bitmap bitmap)
	{
		_icon = bitmap;
	}
	
	public void setName(String name)
	{
		_name = name;
	}
}
